<template>
  <div class="about">
    <van-nav-bar title="门店详情" left-text="" left-arrow @click-left="$router.go(-1)" />
    <van-image class="banner" :src="domain + obj.imagesurl" />
    <div class="location">
      <van-cell :title="obj.address" icon="location" :border="false" />
      <van-cell :title="obj.shop_phone" icon="phone" />
    </div>
    <div class="time">
      <van-cell title="营业时间" icon="clock" :value="`午餐：${obj.noon}，晚餐：${obj.evening}`" />
    </div>
    <div class="desc">
      <van-cell title="公司简介" icon="volume" :value="obj.remark" />
    </div>
  </div>
</template>

<script>
import { Toast } from 'vant';


export default {
  data () {
    return {
      obj: {},
    };
  },
  created () {
    this.getDetail()
  },
  methods: {
    getDetail () {
      this.$axios.get(this.$api.shopinfo).then(res => {
        if (res.data.code == 1) {
          this.obj = res.data.data
          this.obj.noon = this.obj.lunch.join().replace(',', '-')
          this.obj.evening = this.obj.dinner.join().replace(',', '-')
        } else {
          Toast.fail(res.data.msg)
        }
      })
    },
  },
}
</script>

<style lang="less" scoped>
.about {
  height: 100%;
  background-color: #EBEBEB;

  .banner {
    display: block;
    width: 100%;
    height: 222px;
  }

  .location,
  .time,
  .desc {
    font-size: 16px;
    color: #5F5F5F;
    margin-bottom: 15px;

    .van-icon {
      margin-right: 12px;
    }

    .van-cell {

      .van-cell__title,
      .van-cell__value {
        color: #5F5F5F;
        font-size: 16px;
      }

      .van-cell__value {
        flex: 3;
        text-align: left;
      }
    }
  }

}
</style>